<div class="bjui-pageHeader" style="background-color:#fefefe; border-bottom:none;">
    <form data-toggle="ajaxsearch" data-options="{searchDatagrid:$.CurrentNavtab.find('#bill-list')}">
        <fieldset>
            <legend style="font-weight:normal;">页头搜索：</legend>
            <div style="margin:0; padding:1px 5px 5px;">

                <span>关键字</span>
                <input type="text" name="owner" class="form-control" size="15">
                <span>类型</span>
                <select data-toggle="selectpicker" name="related_type">
                    <option value="" selected="">全部</option>
                    <option value="1">公文流程</option>
                    <option value="2">请假流程</option>
                </select>
                <div class="btn-group">
                    <button type="submit" class="btn-green" data-icon="search">开始搜索！</button>
                    <button type="reset" class="btn-orange" data-icon="times">重置</button>
                </div>
            </div>
        </fieldset>
    </form>
</div>
<div class="bjui-pageContent">
    <table class="table table-bordered" id="bill-list" data-toggle="datagrid" data-options="{
    height: '100%',
    gridTitle : '公文列表',
    {{--showToolbar: true,--}}
    fullGrid:true,
    fieldSortable:false,
    filterThead:false,
    filterMult:false,
    columnMenu:false,
    local: 'remote',
    dataUrl:'admin/administration/workflow/done-list',
    {{--toolbarCustom: toolbar,--}}
    linenumberAll: true
}">
        <thead>
        <tr>
            <th data-options="{name:'serial_number',align:'center',width:70}">流水号</th>
            {{--<th data-options="{name:'title',align:'center',width:70}">标题</th>--}}
            <th data-options="{name:'related_type_str',align:'center',width:70}">流程名称</th>
            <th data-options="{name:'creator_name',align:'center',width:70}">创建人</th>
            <th data-options="{name:'created_at_str',align:'center',width:70}">创建时间</th>
            <th data-options="{name:'dispose_code_str',align:'center',width:70}">状态</th>
            <th data-options="{name:'',align:'center',width:70,render:flowChartColumn}">流程图</th>
            <th data-options="{name:'has_enclosure',align:'center',width:70,type:'select',items:[{'0':'未上传'},{'1':'已上传'}]}">附件</th>
            <th data-options="{align:'center',render:operationColumn}">操作</th>
        </tr>
        </thead>
    </table>
</div>
<script>

    function flowChartColumn(value,data){
        var html = '<button type="button" class="btn btn-blue" data-toggle="navtab" data-options="{id:\'workflow_detail1\', url:\'admin/administration/workflow/detail\',fresh:true,title:\'详情\',data:{workflow_id:'+data.id+'}}">查看流程图</button>';
        return html;
    }
    function operationColumn(value, data) {
        var html = '<button type="button" class="btn btn-blue" data-toggle="navtab" data-options="{id:\'workflow_detail1\', url:\'admin/administration/workflow/detail\',fresh:true,title:\'详情\',data:{workflow_id:'+data.id+'}}">办理</button>';
        return html;
    }

    function toolbar() {
        var html = '<button type="button" class="btn btn-blue"  data-toggle="dialog" data-options="{id:\'bill-add\', url:\'/admin/administration/cost-management/bill-add\', title:\'添加账单\',width:900,height:400,data:{addFlag:1}, mask:true}"><i class="fa fa-plus"></i> 添加</button>';
        html += '<button type="button" class="btn btn-blue"  data-toggle="dialog" data-options="{id:\'bill-import\', url:\'/admin/administration/cost-management/bill-import\', title:\'导入账单\',width:500,height:400,data:{addFlag:1}, mask:true}"><i class="fa fa-plus"></i> 导入</button>';
//        html+='<button type="button" class="btn btn-blue"  data-toggle="dialog" data-options="{id:\'electricity-bill-export\', url:\'/urcbwyjr/property-manage/electricity-bill-export\', title:\'添加收费标准\',width:500,height:400,data:{addFlag:1}, mask:true}"><i class="fa fa-plus"></i> 导出</button>';
        return html;
    }
</script>